/*


 */

package jas.rpc.client;

import jas.rpc.*;

/**
 * Provides access to remote procedure calls on some server.
 */
public interface RpcClient {
	/**
	 * Executes a remote procedure call.
	 * @param returnType the expected return type.
	 * @param objectId ID of the object to call on.
	 * @param methodName name of the method to call
	 * @param params arguments to send to the method.
	 * @param parameterClasses exact types of the formal parameters, to accomodate for overloaded methods.
	 * @return the object returned by the method, or null if it is a void method.
	 * @throws RemoteException
	 */
    <T> T remoteCall(Class<T> returnType, String objectId, String methodName, Object[] params, Class[] parameterClasses) 
            throws RemoteException;
    
    /**
     * Returns the remote object with the specified id.
     * @param objectType type of the object's interface
     * @param id the object's ID
     * @return a stub for the object
     */
    <T> T getRemote(Class<T> objectType, String id);
}
